#include <iostream>
#include <math.h>
#include <conio.h>

double f1(double x2)
{
	return (sin(x2) - 1.0) / 2.0;
}

double f2(double x1)
{
	return cos(x1 + 0.5) - 2.0;
}

int main(int argc, char argv[])
{
	double epsilon = 0.0001;

	double x1 = 0.0;
	double x2 = 0.0;

	while(fabs(f1(x2) - x1) > epsilon 
		||	fabs(f2(x1) - x2) > epsilon
		)
	{
		x1 = f1(x2);
		x2 = f2(x1);
	}

	std::cout << "Resultat: x1 = " << x1 << "  x2 = " << x2;

	getch();

	return 0;
}
